<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // window.onload = function(){
        //     alert(1);
        // }
        // window.onload = function(){
        //     alert(2);
        // }
            //1.声明函数
            function fn1(){
                console.log("fn1");
            }
            fn1();
            let fn2 =()=>{
                console.log("fn2");
            }
            fn2();
            //2.表达式函数
            var fn3 = function(a){
                console.log("fn3"+a);
                return 3;
            }
            fn3("hello");
            let fn4 = (a) =>{
                console.log("fn4"+a);
                return 4;
            }
            fn4("hello");
    </script>
</body>
</html>